package com.cgtong.android.mvp.model;

import com.cgtong.android.bean.AdviseBean;
import com.cgtong.android.http.ApiManager;
import com.cgtong.android.mvp.contract.GetAdviseContract;
import com.zhouyou.http.EasyHttp;
import com.zhouyou.http.callback.SimpleCallBack;
import com.zhouyou.http.exception.ApiException;

import java.util.List;

/**
 * Created by Tinwai on 2017/10/25.
 */
public class GetAdviseModel implements GetAdviseContract.Model {
    @Override
    public void getAdviseList(final SimpleCallBack<List<AdviseBean>> callBack) {
        EasyHttp.post(ApiManager.URL_GETFEEDBACK)
                .execute(new SimpleCallBack<List<AdviseBean>>() {
                    @Override
                    public void onError(ApiException e) {
                        callBack.onError(e);
                    }

                    @Override
                    public void onSuccess(List<AdviseBean> result) {
                        callBack.onSuccess(result);
                    }
                });
    }
}
